[NOMERGE] feat: openapi migration progress#150
[NOMERGE] feat: openapi migration progress#150ahmed-n-abdeltwab wants to merge 23 commits intoRocketChat:mainfrom
Conversation
…ser-management.yaml
|
Hey @ahmed-n-abdeltwab , I'd like to take on the rooms.leave migration. I don't see any open PR for it. Can I go ahead? |
Please go ahead, but mention this PR so I can mark it yours, because this way no one can duplicate the work |
|
@Verifieddanny, once your PR is merged, could you please remove your old API like me? |
|
Yes I will 🫡 |
|
Hi @ahmed-n-abdeltwab , I'd like to claim rooms.hide and rooms.open for migration. I don't see any open PRs for these. Can I go ahead?" |
sure go ahead |
|
Hi @ahmed-n-abdeltwab |
I’ve submitted a PR for the statistics.list endpoint. Please pick one that hasn't been mentioned by someone else so we don't duplicate the work. There are enough APIs for everyone, and we want to avoid overlapping on the same PRs. |
|
|
Hey @ahmed-n-abdeltwab, I'd like to claim the mailer and mailer.unsubscribe endpoints for migration. No open PRs for these. Going ahead! |
Ok, sure |
|
Hi @ahmed-n-abdeltwab, |
yes, it's available |
|
Hey @ahmed-n-abdeltwab, I'd like to claim chat.delete and chat.react for migration. No open PRs for these. Can I go ahead? |
sure, go ahead |
|
@sezallagwal , @Yashika-code , @amitb0ra could you mention this PR after opening yours so i could links the Endpoints that you requests to yours, thanks |
sure , i will |
|
As requested, linking my PR here, please review it: |
|
I have raised the PR. Please review when you get a chance. |
|
I’d like to work on migrating the remaining Messaging (chat.*) endpoints. Please let me know if they’re available. |
|
I’d like to work on migrating the remaining Authentication endpoints. Please let me know if they’re available. |
Sure, but I recommend focusing on one detected API per PR. Don't try to handle more than one unless you're absolutely sure, because you’ll likely run into bugs. I’ve reviewed them myself and know just how complex that chat logic can get |
|
Hi @ahmed-n-abdeltwab , I'd like to migrate the chat.reportMessage endpoint to the new openAPI + AJV pattern. Can i go ahead? |
Sure, go ahead |
OpenAPI Migration Progress
This PR tracks the ongoing progress of migrating
Rocket.Chat APIendpoints to the new OpenAPI pattern with AJV validation and improved documentation. It will be continuously updated to reflect completed and remaining work.✅ Summary
👥 Team
🚨 Core API Endpoints
These are 500 endpoints critical for core features and should be migrated first:
Authentication (0 / 9 completed)
Content Management (2 / 11 completed)
emoji-custom.createchore: Add OpenAPI Support to emoji-custom.create API Rocket.Chat#36523custom-user-status.listchore: Add OpenAPI Support to custom-user-status.list API Rocket.Chat#36916Integrations (7 / 13 completed)
webdav.getMyAccountsfeat: Add OpenAPI Support to Webdav API Rocket.Chat#35884webdav.removeWebdavAccountfeat: Add OpenAPI Support to Webdav API Rocket.Chat#35884oauth-apps.createfeat: Add OpenAPI Support to oauth-apps.create API Rocket.Chat#36507oauth-apps.updatefeat: Add OpenAPI Support to oauth-apps.update API Rocket.Chat#36585oauth-apps.listfeat: Add OpenAPI Support to oauth-apps.list API Rocket.Chat#36586oauth-apps.getfeat: Add OpenAPI Support to oauth-apps.get API Rocket.Chat#36598oauth-apps.deletefeat: Add OpenAPI Support to oauth-apps.delete API Rocket.Chat#36606Marketplace Apps (0 / 4 completed)
Messaging (4 / 39 completed)
chat.pinMessagefeat: Add OpenAPI Support to chat.pinMessage API Rocket.Chat#36020chat.unPinMessagefeat: Add OpenAPI Support to chat.unpinMessage API Rocket.Chat#36668dm.closechore: Add OpenAPI Support to dm.close/im.close API Rocket.Chat#38974dm.deletefeat: Add OpenAPI Support to dm.delete/im.delete API Rocket.Chat#36677Omnichannel (0 / 154 completed)
Miscellaneous (2 / 24 completed)
autotranslate.translateMessagechore: Add OpenAPI support for the Rocket.Chat autotranslate translateMessage API Rocket.Chat#38978commands.getchore: Add OpenAPI Support to commands.get API Rocket.Chat#36953removeInvite/:_idendpoint to chained API pattern with AJV validation Rocket.Chat#39200Notifications (0 / 6 completed)
Rooms (3 / 127 completed)
rooms.leavechore: migrate rooms.leave endpoint to new OpenAPI pattern with AJV validation Rocket.Chat#38957rooms.favoritechore: Add OpenAPI Support to rooms.favorite API Rocket.Chat#35995Settings (9 / 47 completed)
e2e.fetchMyKeyschore: Add OpenAPI Support to e2e.fetchMyKeys API Rocket.Chat#36779e2e.getUsersOfRoomWithoutKeychore: Add OpenAPI Support to e2e.getUsersOfRoomWithoutKey API Rocket.Chat#36786e2e.setRoomKeyIDfeat: Add OpenAPI Support to e2e.setRoomKeyID API Rocket.Chat#36716e2e.rejectSuggestedGroupKeychore: Add OpenAPI support for the Rocket.Chat e2e endpoints Rocket.Chat#39219e2e.acceptSuggestedGroupKeychore: Add OpenAPI support for the Rocket.Chat e2e endpoints Rocket.Chat#39219e2e.fetchUsersWaitingForGroupKeychore: Add OpenAPI support for the Rocket.Chat e2e endpoints Rocket.Chat#39219e2e.provideUsersSuggestedGroupKeyschore: Add OpenAPI support for the Rocket.Chat e2e endpoints Rocket.Chat#39219e2e.resetRoomKeychore: Add OpenAPI support for the Rocket.Chat e2e endpoints Rocket.Chat#39219e2e.updateGroupKeychore: Add OpenAPI support for the Rocket.Chat e2e.updateGroupKey endpoints Rocket.Chat#39094Statistics (0 / 15 completed)
User Management (4 / 53 completed)
permissions.listAllfeat: Add OpenAPI Support to Permissions API Rocket.Chat#35985permissions.updatefeat: Add OpenAPI Support to Permissions API Rocket.Chat#35985roles.listendpoint to new chained API pattern with OpenAPI Rocket.Chat#39194roles.syncendpoint to chained API pattern with AJV validation Rocket.Chat#39196Let me know if you'd like these grouped, categorized, or documented further.
📝 Secondary API Endpoints
These 2 endpoints are lower priority and can be migrated after core APIs: (calculating...)
Statistics (0 / 1 completed)
User Management (1 / 1 completed)
users.getAvatarSuggestionchore: Add OpenAPI Support to users.getAvatarSuggestion API Rocket.Chat#36402Notifications (1 / 1 completed)
push.testchore: Add OpenAPI Support to push.test API Rocket.Chat#36882📌 Important Notes
When migrating endpoints to the new OpenAPI + AJV pattern, keep these points in mind:
No Change in Logic
Error Response Codes
400(Bad Request) → Should be included for most endpoints with input validation.401(Unauthorized) → Add only if the endpointauthRequired: trueis included.403(Forbidden) → Add only if specific permission checks are performed.Schema Validation
$refschemas where available instead of manually defining large object shapes.Centralized Error Validators
validateBadRequestErrorResponseinstead of hard-coding error schemas.Route Definition Style
.post(),.get(), etc.).ExtractRoutesFromAPIautomatically groups routes under the same path in the type definitions.Optional Properties
permissionsRequired, omit it.No More
rest-typingsor Manual Typingsrest-typingsor other manual typing files — everything for an endpoint lives in one place for easier maintenance.Swagger Documentation
📖 Example: Migrating from Old Pattern to New Pattern
This example shows how to migrate from the legacy
addRouteapproach (with manual typings and deprecated validation)to the new typed API definition pattern using:
API.v1.post()/.get()chaining (so multiple HTTP methods for the same path are merged in typings)$reffor shared model schemasExtractRoutesFromAPI(no more manual duplication)Before – Old Pattern
Problems with the old approach:
validateParamsis deprecated → doesn’t integrate with the new pattern.rest-typings→ easy to forget or let them get out of sync.After – New Pattern
Key Improvements in the New Pattern
Single source of truth for typings
ExtractRoutesFromAPIpulls types directly from yourpost()/get()definitions — no more manual edits inrest-typings.Strong request validation with AJV
Both
body(POST) andquery(GET) are validated against JSON schemas.Strong response validation
Ensures the API always returns objects that match the documented shape.
Reusable schemas with Typia
$ref: '#/components/schemas/IBaz'links to a single IBaz schema used across APIs.Predefined error validators
validateBadRequestErrorResponse,validateUnauthorizedErrorResponse,validateForbiddenErrorResponsereplace repetitive error schemas.Chaining multiple methods on the same path
Calling
.post().get()on the samefooEndpointsensures both methods are merged into one entry in the generatedEndpointsinterface.🧪 Testing Plan
💡 Notes